package com.ruoyi.factorydata.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 工单工序数据对象 work_order_process_info
 *
 * @author ruoyi
 * @date 2025-08-06
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(resultMap = "com.ruoyi.factorydata.mapper.WorkOrderProcessInfoMapper.WorkOrderProcessInfoResult")
public class WorkOrderProcessInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 项目id
     */
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 项目编码
     */
    @Excel(name = "项目编码")
    private String projectCode;

    /**
     * 生产项目产品id
     */
    @Excel(name = "生产项目产品id")
    private Long projectProductionId;

    /**
     * 计划id
     */
    @Excel(name = "计划id")
    private Long planId;

    /**
     * 计划编号
     */
    @Excel(name = "计划编号")
    private String planCode;

    /**
     * 工单编号
     */
    @Excel(name = "工单编号")
    private String workOrderCode;

    /**
     * 工单id
     */
    @Excel(name = "工单id")
    private Long workOrderId;

    /**
     * 工艺id
     */
    @Excel(name = "工艺id")
    private Long craftId;

    /**
     * 工序步骤
     */
    @Excel(name = "工序步骤")
    private Integer step;

    /**
     * 工序id
     */
    @Excel(name = "工序id")
    private Long processId;

    /**
     * 工序编码
     */
    @Excel(name = "工序编码")
    private String processCode;

    /**
     * 工序名称
     */
    @Excel(name = "工序名称")
    private String processName;

    /**
     * 工序负责人id
     */
    private Long processOrderOwnerId;

    /**
     * 开工时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开工时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /**
     * 完工时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "完工时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic(value = "0", delval = "2")
    private String delFlag;

    /**
     * 版本号
     */
    @Excel(name = "版本号")
    @Version
    private Long version;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("projectId", getProjectId())
                .append("projectCode", getProjectCode())
                .append("projectProductionId", getProjectProductionId())
                .append("planId", getPlanId())
                .append("planCode", getPlanCode())
                .append("workOrderCode", getWorkOrderCode())
                .append("workOrderId", getWorkOrderId())
                .append("craftId", getCraftId())
                .append("step", getStep())
                .append("processId", getProcessId())
                .append("processCode", getProcessCode())
                .append("processName", getProcessName())
                .append("startTime", getStartTime())
                .append("endTime", getEndTime())
                .append("delFlag", getDelFlag())
                .append("version", getVersion())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .toString();
    }
}